package string;

public class IndexOfDemo {
    public static void main(String[] args) {
        String str1 = "Hello World";
        int index1 = str1.indexOf("o" ,3);
        int index4 = str1.indexOf("o" ,10);
        System.out.println(index1);
        System.out.println(index4);
        int index2 = str1.lastIndexOf("o" ,1);
        System.out.println(index2);
        int index3 = str1.lastIndexOf("o" );
        System.out.println(index3);
    }
}